package com.zpark.controller;
import com.zpark.bean.User;
import com.zpark.bean.R;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import java.util.List;

@RestController
@RequestMapping("validate")
public class ValidateController {
    @GetMapping("/test")
    public R test(@NotBlank(message = "名称不能为空")String name){
        return R.ok();
    }

    @PostMapping("test1")
    public R testValidate(@RequestBody @Valid User user){
        System.out.println(user);
        return R.ok();
    }

    @PostMapping("/test2")
    public R addUserList(@RequestBody List<@Valid User> userList){
        return R.ok();
    }

}



